// 读取用户进入页面的时间数据
import {defineStore} from 'pinia'
import {ref} from 'vue'
import {HTTP} from "@/api/HTTP.js";

const useTimeStore = defineStore('useTime', () => {
    const enterTime = ref(null);
    const leaveTime = ref(null);

    const recordEnterTime = () => {
        enterTime.value = new Date();
    };

    const recordLeaveTime = () => {
        leaveTime.value = new Date();
    };

    return {
        enterTime,
        leaveTime,
        recordEnterTime,
        recordLeaveTime
    };
})

export default useTimeStore